import request from "@/utils/http";

/**
 * 获取列表数据
 * @param {*} id
 * @returns
 */
export const getCategoryAPI = (id) => {
  return request({
    url: "/category",
    params: {
      id,
    },
  });
};
/**
 * 二级列表面包屑
 * @param {} id
 * @returns
 */

export const getCategoryFilterAPI = (id) => {
  return request({
    url: "/category/sub/filter",
    params: {
      id,
    },
  });
};

/**
 * 商品列表
 * @param {
 * categoryId:1005000,
 * page:1,
 * pageSize:20,
 * sortField:'publishTime' | 'orderNum' | 'evaluateNum'
 * } data
 * @returns {*}
 */
export const getSubCategoryAPI = (data) => {
  return request({
    url: "/category/goods/temporary",
    method: "POST",
    data,
  });
};
